package com.css.crm.vo;

import java.io.Serializable;
import java.util.ArrayList;

public class MenuGroup implements Comparable<MenuGroup>, Serializable, Cloneable{
	
	private static final long serialVersionUID = 1L;
	private String mugpId;
	private String groupName;
	private Integer groupSeq;
	private ArrayList<MenuItem> menuItemList;
	
	public String getMugpId() {
		return mugpId;
	}
	public void setMugpId(String mugpId) {
		this.mugpId = mugpId;
	}
	public String getGroupName() {
		return groupName;
	}
	public void setGroupName(String groupName) {
		this.groupName = groupName;
	}
	public Integer getGroupSeq() {
		return groupSeq;
	}
	public void setGroupSeq(Integer groupSeq) {
		this.groupSeq = groupSeq;
	}
	public ArrayList<MenuItem> getMenuItemList() {
		return menuItemList;
	}
	public void setMenuItemList(ArrayList<MenuItem> menuItemList) {
		this.menuItemList = menuItemList;
	}
	@Override
	public int compareTo(MenuGroup o) {
		if ( o != null ){
			return groupSeq - o.getGroupSeq();
		}
		return -1;
	}
	
	@Override
	public Object clone() {
		MenuGroup o = null;
		try {
			o = (MenuGroup) super.clone();
		} catch (CloneNotSupportedException e) {
			e.printStackTrace();
		}
		o.mugpId = new String(this.mugpId);
		o.groupName = new String(this.groupName);
		o.groupSeq = new Integer(this.groupSeq);
		o.menuItemList = new ArrayList<MenuItem> ();
		for (MenuItem mItem : this.menuItemList ){
			o.menuItemList.add((MenuItem) mItem.clone());
		}
		return o;
	}
}
